<!DOCTYPE html>
<html>
<head><title>PHP View Engine Demo</title></head>
<body>
<p>Stan says hello from static HTML.<p>
<?
	$arr = array(1 => "Dave", 2 => "Penny", 3 => "Tim");
?>
<p>
<? echo $arr[2]." says hello from PHP!"; ?>
</p>
<? echo $viewdata["message"]; ?>
<hr />
<p>Do question marks screw things up?</p>
<p>
<?
	$a = $viewdata['a'];
	$b = $viewdata['b'];
	
	echo "$a + $b = ".adder($a,$b);
?>
</p>
<ol>
<?
foreach ($viewdata['numbers'] as $number)
{
	echo "<li>$number</li>";
} ?>
</ol>
<ul>
<?
// I love the PHP foreach syntax here
foreach ($model as $name => $age)
{
	echo "<li>$name is $age</li>";
} ?>
</ul>
<table border=1>
<?
foreach($route as $key => $value)
{
	echo "<tr><td>$key</td><td>$value</td></tr>";
} ?>
</table>
<hr />
Enter a person's name: 
<? $url = '/'.$route['controller'].'/Display'; ?>
<form action='<? echo $url; ?>' enctype='multipart/form-data' method=post>
<input type='text' name='freetext' />
<input type='submit' value='Submit' />
</form>
<?
/* I put the function way down here
 * to demonstrate that it does not
 * have to come before first use.
 */
function adder ($x, $y) { return $x+$y; }
?>
</body>
</html>